package org.example.service.impl;

import org.example.mapper.OperationalMonitoringMapper;
import org.example.pojo.domain.OperationalMonitoring;
import org.example.service.OperationalMonitoringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OperationalMonitoringServiceImpl implements OperationalMonitoringService {

    @Autowired
    private OperationalMonitoringMapper operationalMonitoringMapper;

    @Override
    public List<OperationalMonitoring> getAllMonitoringData() {
        return operationalMonitoringMapper.findAll();
    }

    @Override
    public OperationalMonitoring getMonitoringDataById(Integer monitorId) {
        return operationalMonitoringMapper.findById(monitorId);
    }

    @Override
    public void addMonitoringData(OperationalMonitoring monitoring) {
        operationalMonitoringMapper.insertMonitoringData(monitoring);
    }

    @Override
    public void updateMonitoringData(OperationalMonitoring monitoring) {
        operationalMonitoringMapper.updateMonitoringData(monitoring);
    }

    @Override
    public void deleteMonitoringData(Integer monitorId) {
        operationalMonitoringMapper.deleteMonitoringData(monitorId);
    }
}
